import java.util.concurrent.Callable;

public class Test10 {
    public static void main(String[] args) {
        Runnable handler = new Runnable() {
            private Object lock = new Object();

            @Override
            public void run() {
                while (true) {
                    synchronized (this) {
                        System.out.println(Thread.currentThread().getName() + " 正在运行");
                        try {
                            this.wait(1000);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                    }
                }
            }
        };

        new Thread(handler, "线程1").start();
        new Thread(handler, "线程2").start();

        Callable<Integer> callable = () -> 0;
    }
}
